/* eslint-disable no-unused-vars */
// { name,type,required,label}

const routerData = [
  {
    path: "/welcome",
    name: "欢迎",
    icon: 'icon-gongzuotai_xuanzhong',
    component: "./Welcome",
  },
  {
    path: "/admin",
    name: "管理页",
    icon: 'icon-Category',
    access: "canAdmin",
    component: "./Admin",
    routes: [
      {
        path: "/admin/sub-page1",
        name: "一级页面",
        icon: "https://gw.alipayobjects.com/zos/antfincdn/upvrAjAPQX/Logo_Tech%252520UI.svg",
        component: "./Welcome",
      },
      {
        path: "/admin/sub-page2",
        name: "二级页面",
        component: "./Welcome",
      },
      {
        path: "/admin/sub-page3",
        name: "三级页面",
        component: "./Welcome",
      },
    ],
  },
  {
    name: "列表页",
    icon: 'icon-List',
    path: "/list",
    component: "./ListTableList",
    routes: [
      {
        path: "/list/sub-page",
        name: "列表页面",
        icon: 'icon-zip',
        routes: [
          {
            path: "/list/sub-page/sub-sub-page1",
            name: "一一级列表页面",
            component: "./Welcome",
          },
          {
            path: "/list/sub-page/sub-sub-page2",
            name: "一二级列表页面",
            component: "./Welcome",
          },
          {
            path: "/list/sub-page/sub-sub-page3",
            name: "一三级列表页面",
            component: "./Welcome",
          },
        ],
      },
      {
        path: "/list/sub-page2",
        name: "二级列表页面",
        icon: 'icon-yunpan',
        component: "./Welcome",
      },
      {
        path: "/list/sub-page3",
        name: "三级列表页面",
        icon: 'icon-mp3',
        component: "./Welcome",
      },
    ],
  },
  {
    path: "https://ant.design",
    name: "Ant Design 官网外链",
    icon: 'icon-gonggao',
  },
];

export async function getInitialState() {
  const colProps = {span : 12};
  return {
    formControls: [], //选择的组件列表 
    activeItem: {}, //选中的组件
    //表单配置
    formConfig: {
      grid: true,
      layout: "vertical", //['horizontal', 'vertical', 'inline']
      rowProps: {
        gutter: 12,
      },
      colProps,
    }, 
    //调用接口
    submitconfig:{
      config: {},
      result: {},
    },
    //路由数据
    routerData,
    //layout配置
    extralayout:{
      iconfontUrl:"//at.alicdn.com/t/c/font_3865952_s2kv9795ok.js"
    },
    preview:false
  };
}
